﻿package net.wangit.view.unit;

import net.wangit.framework.cache.Cache;
import net.wangit.framework.util.CacheUtil;

public class UnitCache {

	public UnitCache() {
	}

	public static UnitComponent get(String domain, String unitId) {
		return (UnitComponent) getCache(domain).get(unitId);
	}

	public static void put(String domain, String unitId, UnitComponent unit) {
		getCache(domain).put(unitId, unit);
	}

	public static void clear(String domain, String unitId) {
		getCache(domain).clear(unitId);
	}

	public static void clearAll(String domain) {
		getCache(domain).clearAll();
	}

	private static Cache getCache(String domain) {
		return CacheUtil.getUnitCache(domain);
	}
}
